#include <iostream>

using namespace std;
typedef long long LL;
const int N = 1e5 + 10;
LL n, k;
LL a[N], b[N];
int main()
{
    cin >> n >> k;
    for (int i = 1; i <= n; i++) cin >> a[i];
    for (int i = 1; i <= n; i++) cin >> b[i];

    LL left = 0, right = 0, asum = 0, bsum = 0;
    LL begin = 0, aMax = 0, bMin = 0;
    while (right <= n)
    {
        asum += a[right];
        bsum += b[right];

        while (right - left + 1 > k)
        {
            asum -= a[left];
            bsum -= b[left];
            left++;
        }

        if (right - left + 1 == k)
        {
            if (asum > aMax)
            {
                begin = left;
                aMax = asum;
                bMin = bsum;
            }
            else if (asum == aMax && bsum < bMin)
            {
                begin = left;
                aMax = asum;
                bMin = bsum;
            }
        }
        right++;
    }

    cout << begin << endl;
    return 0;
}